<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<script type="text/javascript">
	function sendPush() {
		$.ajax({
			url: "sendGcm.ga",
			type: "post",
			dataType: "html",
			data: {
				content: $("#content").val()
			},
			success: function(data) {
				alert("푸시메시지를 발송하였습니다.");
				$("#result").html(data);
			},
			error: function() {
				alert("오류");
			}
		});
	}

</script>

</head>
<body>

<h2>푸시 메시지 보내기</h2>
<textarea rows="5" cols="130" id="content" style="resize:none;"></textarea><br/>
<input type="button" value="푸시 발송" onclick="sendPush()"/>
<br/><br/>

<div id="result"></div>

</body>
</html>